package com.liusy.taskengine.resultmodel;

import java.util.List;
import java.util.Map;

import net.sf.json.JSONSerializer;

import com.liusy.common.ObjectXMLSerializer;

/**
 * 比对结果模型
 * 
 * @author liusy 2013-04-16
 *
 */
public class ComparResult extends Thread{
	
	private Map<String,Object> rowTaskMap;
	
	private List<Map<String,Object>> rowRusltListMap;
	
	private String executesqlModelSql;

	private IResultModel rm = null;
	@Deprecated
	public synchronized void start() {
		// TODO Auto-generated method stub
		super.start();
	}
	
	public synchronized void start(IResultModel rm) {
		this.rm = rm;
		super.start();
	}

	@Override
	public void run() {
		if(null!=rm)
		{
			rm.addComparResults(this);
		}
	}

	public ComparResult(Map<String, Object> rowTaskMap,
			List<Map<String, Object>> rowRusltListMap, String executesqlModelSql) {
		super();
		this.rowTaskMap = rowTaskMap;
		this.rowRusltListMap = rowRusltListMap;
		this.executesqlModelSql = executesqlModelSql;
	}
	

	public Map<String, Object> getRowTaskMap() {
		return rowTaskMap;
	}

	public void setRowTaskMap(Map<String, Object> rowTaskMap) {
		this.rowTaskMap = rowTaskMap;
	}

	public List<Map<String, Object>> getRowRusltListMap() {
		return rowRusltListMap;
	}

	public void setRowRusltListMap(List<Map<String, Object>> rowRusltListMap) {
		this.rowRusltListMap = rowRusltListMap;
	}

	public String getExecutesqlModelSql() {
		return executesqlModelSql;
	}

	public void setExecutesqlModelSql(String executesqlModelSql) {
		this.executesqlModelSql = executesqlModelSql;
	}
	public String ComparResultToXML(){
		
		return ObjectXMLSerializer.serialize(this);
	}
	public String ComparResultToJson(){
		
		return JSONSerializer.toJSON(this).toString();
	}
}
